//
//  RCNetSocketRequest.m
//  RCNetRequestProject
//
//  Created by kabu on 2017/8/14.
//  Copyright © 2017年 RC. All rights reserved.
//

#import "RCNetSocketRequest.h"
@interface RCNetSocketRequest()

@end
@implementation RCNetSocketRequest

-(instancetype)initWithSendSerializationer:(id<RCSocketSendSerialization>)aSendSerializationer acceptSerializationer:(id<RCSocketAcceptSerialization>)aAcceptSerializationer{
    self =[RCNetSocketRequest sharedInstance];
    if (self) {
        _senderSerializationer=aSendSerializationer;
        _acceptSerializationer=aAcceptSerializationer;
    }
    return self;
}
-(void)setSender:(id<RCSocketSendSerialization>)aSendSerializationer accepter:(id<RCSocketAcceptSerialization>)aAcceptSerializationer{
    _senderSerializationer=aSendSerializationer;
    _acceptSerializationer=aAcceptSerializationer;
}
+(instancetype)sharedInstance{
    static RCNetSocketRequest *shared=nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        shared = [[self alloc]init];
        RCSocketSendSerializationer *sender=[RCSocketSendSerializationer serializationer];
        RCSocketAcceptSerializationer *accepter=[RCSocketAcceptSerializationer serializationer];
        [shared setSender:sender accepter:accepter];
    });
    return shared;
}

#pragma mark RCNetSocket
-(void)setRCServerSocketCallBack:(RCServerSocketCallBack)aCallback{
    
}
- (void) connectIP:(NSString *)ip port:(int)aPort callBack:(RCConnectSocketCallBack)aCallBack{
    
}
- (NSInteger) write:(id)message{
    return 0;
}
- (NSData*) read:(uint8_t)buf{
    return [NSData data];
}
- (void) disconnect{
    
}
@end
